/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.woupla.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

/**
 *
 * @author Dimitri Lebel
 */
@Embeddable
public class CompanyproduitPK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -5668952679766903014L;
	@Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private int id;
    @Basic(optional = false)
    @Column(name = "Company")
    private Long company;
    @Basic(optional = false)
    @Column(name = "produit")
    private int produit;

    public CompanyproduitPK() {
    }

    public CompanyproduitPK(int id, Long company, int produit) {
        this.id = id;
        this.company = company;
        this.produit = produit;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Long getCompany() {
        return company;
    }

    public void setCompany(Long long1) {
        this.company = long1;
    }

    public int getProduit() {
        return produit;
    }

    public void setProduit(int produit) {
        this.produit = produit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        hash += company.intValue();
        hash += (int) produit;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompanyproduitPK)) {
            return false;
        }
        CompanyproduitPK other = (CompanyproduitPK) object;
        if (this.id != other.id) {
            return false;
        }
        if (this.company != other.company) {
            return false;
        }
        if (this.produit != other.produit) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "javaapplication1.CompanyproduitPK[ id=" + id + ", company=" + company + ", produit=" + produit + " ]";
    }
    
}
